package work02;

import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        Teacher[] t = {
                new CommonTeacher(),
                new HighTeacher(),
                new SuperfineTeacher()
        };
        while (true) {
            System.out.println("请输入教师的工资来评判教师等级");
            double a = new Scanner(System.in).nextDouble();
            if (a < 0 || a > 1000000000) {
                System.out.println("输入有错请重新输入");
            } else if (a <10000) {
                t[0].pay(a);
                break;
            } else if (a <25000) {
                t[1].pay(a);
                break;
            }else {
                t[2].pay(a);
                break;
            }

        }
    }
}
